<template>
	<view class="container">
		<!-- 基本信息 -->
		<view v-if="currentStep === 0">
			<h2 class="title">{{app.language.tbrInfo}}</h2>
			<view class="infoBox">
				<!-- 姓名 -->
				<view class="formItem1">
					<text>{{ app.language.name }}:</text>
					<view class="formB">
						{{info.name}}
					</view>
				</view>
				<!-- 公民身份证号 -->
				<view class="formItem1">
					<text>{{ app.language.card }}:</text>
					<view class="formB">
						{{info.card}}
					</view>
				</view>
				<!-- 联系电话 -->
				<view class="formItem1">
					<text>{{ app.language.phone }}:</text>
					<view class="formB">
						{{info.phone}}
					</view>
				</view>
			</view>
		</view>
		<view v-if="currentStep === 1">
			<h2 class="title">{{app.language.ldyInfo}}</h2>
			<view class="infoBox">
				<!-- 旅店业名称 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_name }}:</text>
					<view class="formB">
						<input type="text" v-model="form.hotelName" :placeholder="app.language.ldy_Iname" />
					</view>
				</view>
				<!-- 地址 -->
				<view class="formItem1">
					<view>
						<text><text class="bt">*</text>{{ app.language.ldy_address }}:</text>
						<!-- 三级联动组件 -->
						<!-- <area-picker v-if="areaData.provinces.length > 0" :area-data="areaData"
							:default-area="defaultArea" @change="handleFirstAreaChange" /> -->
							<view class="formB">
								<input type="text" v-model="form.address" :placeholder="app.language.ldy_address" />
							</view>
					</view>
				</view>
				<!-- 管辖派出所 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.gxsldw }}:</text>
					<view class="formB">
						<picker mode="selector" name="pcs" :range="pcssList" @change="onpcsChange">
							<view class="picker">
								{{selectedpcsValue}}
							</view>
						</picker>
					</view>
				</view>
				<!-- 特种行业证号 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_adminNumber }}:</text>
					<view class="formB">
						<input type="text" v-model="form.specialIndustryCertificateNumber"
							:placeholder="app.language.ldy_IadminNumber" />
					</view>
				</view>
				<!-- 占地面积 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_zdarea }}:</text>
					<view class="formB">
						<input type="text" v-model="form.coverArea" :placeholder="app.language.ldy_Izdarea" />
					</view>
				</view>
				<!-- 经济性质 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_jjxz }}:</text>
					<view class="formB">
						<picker mode="selector" name="pcs" :range="jzlist" @change="onChange">
							<view class="picker">
								{{selectedValue}}
							</view>
						</picker>
					</view>
				</view>
				<!-- 建筑性质 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_jzxz }}:</text>
					<view class="formB">
						<picker mode="selector" name="pcs" :range="list" @change="onJzChange">
							<view class="picker">
								{{selectedJzValue}}
							</view>
						</picker>
					</view>
				</view>
				<!-- 经营面积 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_jyarea }}:</text>
					<view class="formB">
						<input type="text" v-model="form.operatingArea" :placeholder="app.language.ldy_Ijyarea" />
					</view>
				</view>
				<!-- 房栋数 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_fds }}:</text>
					<view class="formB">
						<input type="text" v-model="form.buildNumber" :placeholder="app.language.ldy_Ifds" />
					</view>
				</view>
				<!-- 客房数量 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_kfNum }}:</text>
					<view class="formB">
						<input type="text" v-model="form.roomNumber" :placeholder="app.language.ldy_IkfNum" />
					</view>
				</view>
				<!-- 床位数 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_cwNum }}:</text>
					<view class="formB">
						<input type="text" v-model="form.bedNumber" :placeholder="app.language.ldy_IcwNum" />
					</view>
				</view>
				<!-- 总台电话 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_ztPhone }}:</text>
					<view class="formB">
						<input type="text" v-model="form.phoneNumber" :placeholder="app.language.ldy_IztPhone" />
					</view>
				</view>
				<!-- 电梯设置 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_dtsz }}:</text>
					<view class="formB">
						<input type="text" v-model="form.elevatorSetup" :placeholder="app.language.ldy_Idtsz" />
					</view>
				</view>
				<!-- 法人 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_legalPerson }}:</text>
					<view class="formB">
						<input type="text" v-model="form.legalPerson" :placeholder="app.language.ldy_IlegalPerson" />
					</view>
				</view>
				<!-- 身份证号码 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.ldy_card }}:</text>
					<view class="formB">
						<input type="text" v-model="form.legalIdcard" :placeholder="app.language.ldy_Icard" />
					</view>
				</view>
				<!-- 手机号码 -->
				<view class="formItem1">
					<text><text class="bt">*</text>{{ app.language.phone }}:</text>
					<view class="formB">
						<input type="phone" v-model="form.legalPhone" :placeholder="app.language.Iphone" />
					</view>
				</view>
			</view>
		</view>
		<view v-if="currentStep === 2">
			<h2 class="title">{{app.language.cyryInfo}}</h2>
			<view class="infoBox">
				<view class="form" v-for="(item, index) in basepeopleList" :key="index">
					<image src="../../static/del.png" mode="" class="del" v-if="index>0" @click="handleDel(index)">
					</image>
					<!-- 姓名 -->
					<view class="formItem1">
						<text><text class="bt">*</text>{{ app.language.name }}:</text>
						<view class="formB">
							<input type="text" v-model="basepeopleList[index].name" :placeholder="app.language.Iname" />
						</view>
					</view>
					<!-- 性别 -->
					<view class="formItem1">
						<text><text class="bt">*</text>{{ app.language.gender }}:</text>
						<view class="formB">
							<picker mode="selector" name="gender" :range="genderList"
								@change="onChangeCzGender(index, $event)">
								<view class="picker">
									{{basepeopleList[index].selectedGenderValue}}
								</view>
							</picker>
						</view>
					</view>
					<!-- 身份证号码 -->
					<view class="formItem1">
						<text><text class="bt">*</text>{{ app.language.ldy_card }}:</text>
						<view class="formB">
							<input type="text" v-model="basepeopleList[index].idcard"
								:placeholder="app.language.ldy_Icard" />
						</view>
					</view>
					<!-- 联系电话 -->
					<view class="formItem1">
						<text><text class="bt">*</text>{{ app.language.phone }}:</text>
						<view class="formB">
							<input type="phone" v-model="basepeopleList[index].contactNumber"
								:placeholder="app.language.Iphone" />
						</view>
					</view>
					<!-- 劳务合同 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_contract }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(1,index)">{{ app.language.sclwimg }}</button>
						</view>
						<view class="scimageBox" v-if="basepeopleList[index].contractImg.length>0">
							<view class="del3" @click="delImg(index,1)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in basepeopleList[index].contractImg"
								:key='index' @click="previewImg(item)"></image>
						</view>
					</view>
				</view>
			</view>
			<!-- 新增从业人员 -->
			<view class="txry" @click="handleAdd">
				<view class="jia">
					<image src="../../static/jiahao.png" mode="" class="icon"></image>
					<text>新增</text>
				</view>
			</view>
		</view>
		<view v-if="currentStep === 3">
			<!-- 其他项目及娱乐设施简况 -->
			<view class="currentBox">
				<h2 class="title">{{app.language.qtxmInfo}}</h2>
				<view class="infoBox">
					<view class="form" v-for="(item, index) in otherList" :key="index">
						<!-- 从业人员 -->
						<view class="formItem1">
							<text><text class="bt">*</text>{{ app.language.ldy_xmjyName }}:</text>
							<view class="formB">
								<input type="text" v-model="otherList[index].projectManagementName"
									:placeholder="app.language.ldy_IxmjyName" />
							</view>
						</view>
						<!-- 业主姓名 -->
						<view class="formItem1">
							<text><text class="bt">*</text>{{ app.language.ldy_yzName }}:</text>
							<view class="formB">
								<input type="text" v-model="otherList[index].ownersName"
									:placeholder="app.language.ldy_IyzName" />
							</view>
						</view>
						<!-- 身份证号码 -->
						<view class="formItem1">
							<text><text class="bt">*</text>{{ app.language.ldy_card }}:</text>
							<view class="formB">
								<input type="text" v-model="otherList[index].idcard"
									:placeholder="app.language.ldy_Icard" />
							</view>
						</view>
						<!-- 电话号码 -->
						<view class="formItem1">
							<text><text class="bt">*</text>{{ app.language.phone }}:</text>
							<view class="formB">
								<input type="phone" v-model="otherList[index].phoneNumber"
									:placeholder="app.language.Iphone" />
							</view>
						</view>
						<!-- 从业人员 -->
						<view class="formItem">
							<text><text class="bt">*</text>{{ app.language.ldy_contract }}:</text>
							<view class="hjbImg hjbImg1">
								<button type="default" @click="chooseImg(2,index)">{{ app.language.sclwimg }}</button>
							</view>
							<view class="scimageBox" v-if="otherList[index].cyryImg.length>0">
								<view class="del3" @click="delImg(index,2)">
									<image class="delImg" src="/static/dels.png"></image>
								</view>
								<image class="scimage" :src="apiUrl+i" v-for="(i,key) in otherList[index].cyryImg"
									:key='index' @click="previewImg(item)"></image>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="currentBox">
				<!-- <h2 class="title">{{ app.language.ldy_nfjkNum }}</h2> -->
				<view class="infoBox">
					<!-- 内防监控数量 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_nfjkNum }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(3)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="jmhkbImg.length>0">
							<view class="del3" @click="delImg(jmhkbImg,3)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in jmhkbImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in jmhkbImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 消防设施情况 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_xfssqk }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(4)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="xfImg.length>0">
							<view class="del3" @click="delImg(xfImg,4)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in xfImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in xfImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 内部保安数量 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_baNum }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(5)">{{ app.language.sclwimg }}</button>
						</view>
						<view class="scimageBox" v-if="baImg.length>0">
							<view class="del3" @click="delImg(baImg,5)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in baImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in baImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 防爆器材数量 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_fbqcNum }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(6)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="fbqcImg.length>0">
							<view class="del3" @click="delImg(fbqcImg,6)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in fbqcImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in fbqcImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 消防检查合格证 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_xfhgz }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(7)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="hgzImg.length>0">
							<view class="del3" @click="delImg(hgzImg,7)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in hgzImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in hgzImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 特种行业许可证 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_tzhyxkz }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(8)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="xkzImg.length>0">
							<view class="del3" @click="delImg(xkzImg,8)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in xkzImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in xkzImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 旅店业外部概貌照片 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_ldwm }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(9)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="lvwmImg.length>0">
							<view class="del3" @click="delImg(lvwmImg,9)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in lvwmImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in lvwmImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 旅店业内部概貌照片 -->
					<view class="formItem">
						<text><text class="bt">*</text>{{ app.language.ldy_ldnm }}:</text>
						<view class="hjbImg hjbImg1">
							<button type="default" @click="chooseImg(10)">{{ app.language.scimg }}</button>
						</view>
						<view class="scimageBox" v-if="lvnmImg.length>0">
							<view class="del3" @click="delImg(lvnmImg,10)">
								<image class="delImg" src="/static/dels.png"></image>
							</view>
							<image class="scimage" :src="apiUrl+i" v-for="(i,key) in lvnmImg" :key='index'
								@click="previewImg(item)"></image>
						</view>
						<!-- <image class="scimage" :src="item" v-for="(item,index) in lvnmImg" :key='index' @click="previewImg(item)"></image> -->
					</view>
					<!-- 是否租赁 -->
					<view class="formItem1">
						<text><text class="bt">*</text>{{ app.language.ldy_isLease }}:</text>
						<view class="formB" v-if="!isBtn">
							 <radio-group @change="handleChange" :value="form.isRent">
							      <label class="radio-item" v-for="item in radioOptions" :key="item.value">
							        <radio :value="item.value" :checked="form.isRent === item.value" />
							        {{item.name}}
							      </label>
							    </radio-group>
						</view>
						<view class="scht" v-if="isLeaseShow">
							<view class="hjbImg hjbImg1">
								<button type="default" @click="chooseImg(11)">{{ app.language.sclwimg }}</button>
							</view>
							<view class="scimageBox" v-if="zlImg.length>0">
								<view class="del3" @click="delImg(zlImg,10)">
									<image class="delImg" src="/static/dels.png"></image>
								</view>
								<image class="scimage" :src="apiUrl+i" v-for="(i,key) in zlImg" :key='index'
									@click="previewImg(item)"></image>
							</view>
							<!-- <image class="scimage" :src="item" v-for="(item,index) in lvwmImg" :key='index' @click="previewImg(item)"></image> -->
						</view>
					</view>
				</view>
			</view>
		</view>
		<view>
			<button v-if="currentStep > 0" @click="previousStep"
				class="previousStep">{{ app.language.previousStep }}</button>
			<button v-if="currentStep < steps.length - 1" @click="nextStep"
				class="nextStep">{{ app.language.nextStep }}</button>
			<button v-if="currentStep === steps.length - 1&&!isBtn&&!isTB" @click="submitForm(0)"
				class="submitForm">{{ app.language.tijiao }}</button>
			<button v-if="currentStep === steps.length - 1&&!isBtn&&isTB" @click="submitForm(1)"
				class="submitForm">{{ app.language.yjtb }}</button>
			<button v-if="currentStep === steps.length - 1&&isBtn&&isTB&&xg" @click="submitForm(1)"
				class="submitForm">{{ app.language.djxg }}</button>
		</view>
		<!-- 是否同步的弹窗 -->
		<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0" class="popup">
			<view class="popupBox">
				<view v-for="(item,index) in hotelBaseList" class="popupItem">
					<text>{{item.hotelName}}</text>
					<button @click="handleTb(item)">{{app.language.yjtb}}</button>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import graceChecker from "../../components/graceChecker.js"
	import {
		AddhotelInfo,
		GetHotelInfo,
		GetHotelCyInfo,
		GetHotelQtInfo,
		xghotelInfo
	} from '@/api/form.js'
	import {
		getJzxz,
		getJjxz,
		getJgSq,
		geAgent,
		getPcsList
	} from '@/api/api.js'
	const global = getApp().globalData;
	import config from '@/config.js';
	import {
		fetchAndProcessAreaData
	} from '@/api/processCountryData.js';
	import AreaPicker from '@/components/areapicker.vue';

	export default {
		components: {
			AreaPicker
		},
		data() {
			return {
				// 基础信息表单
				form: {
					chooseImags: [],
				},
				app: {
					global: global,
					name: global.appName,
					language: global.language
				},
				info: {
					name: "",
					card: "",
					phone: "",
				},
				currentStep: 0,
				steps: [{
						id: 0,
						title: '填表人信息'
					},
					{
						id: 1,
						title: '旅店基本信息'
					},
					{
						id: 2,
						title: '从业人员'
					},
					{
						id: 3,
						title: '其他项目及娱乐设施简况'
					},
				],
				// 经济性质
				list: [],
				selectedValue: '',
				jjId: "",
				jianList: [],
				// 建筑性质
				jzlist: [],
				selectedJzValue: "",
				jzId: "",
				jingList: [],
				// 从业人员列表
				basepeopleList: [{
					name: "",
					agent: "",
					idcard: "",
					contactNumber: "",
					serviceContract: "",
					contractImg: [],
					selectedGenderValue: ""
				}],
				// 性别
				genderList: [],
				xingbieList: [],
				// selectedGenderValue:"请选择",
				// 其他项目及娱乐设施简况
				otherList: [{
					projectManagementName: "",
					ownersName: "",
					idcard: "",
					phoneNumber: "",
					employees: "",
					cyryImg: [],
				}],
				// 劳动合同
				contractImg: [],
				// 从业人员劳动合同
				cyryImg: [],
				// 内防监控数量
				jmhkbImg: [],
				// 消防设施
				xfImg: [],
				// 内部保安
				baImg: [],
				// 防爆器材
				fbqcImg: [],
				// 消防检查合格证
				hgzImg: [],
				// 特种行业许可证
				xkzImg: [],
				// 旅店外部照片
				lvwmImg: [],
				// 旅店业内部概貌照片
				lvnmImg: [],
				isLease: "", //是否租赁
				zlImg: [], //租赁合同
				isLeaseShow: false,
				token: "",
				userInfo: {},
				// 地址
				hjsList: [],
				hjList: [],
				selectedAddressValue: "",
				apiUrl: config.baseUrl,
				// 派出所
				selectedpcsValue: "",
				pcsList: [],
				pcssList: [],
				hffuuid: "",
				xingbieList: [],
				genderList: [],
				isBtn: false,
				areaData: {
					provinces: [],
					cities: {},
					areas: {}
				},
				// 同步的数据列表
				hotelBaseList: [],
				seach: {},
				defaultArea: "",
				isTB: false,
				radioOptions:[
					{name: '', value: '1'},
					{name: '', value: '0'},
				],
				currentValue: '' ,// 默认选中B
				xg:false
			};
		},
		async onLoad(options) {
			uni.showLoading({
				title: this.app.language.jzz,
			});
			this.hffuuid = options.hffuuid
			this.selectedValue = this.app.language.qxz
			this.selectedJzValue = this.app.language.qxz
			this.selectedGenderValue = this.app.language.qxz
			this.selectedAddressValue = this.app.language.qxz
			this.selectedpcsValue = this.app.language.qxz
			this.basepeopleList[0].selectedGenderValue = this.app.language.qxz
			this.radioOptions[0].name = this.app.language.yes
			this.radioOptions[1].name = this.app.language.no
			this.areaData = await fetchAndProcessAreaData();
			// 缓存
			this.getToken()
			// 建筑列表
			this.getJzList()
			// 经济列表
			this.getJjList()
			// 性别
			this.getagent()
			// 派出所
			this.getPcs()
			// 旅店业基本信息
			setTimeout(() => {
				this.GetHotel()
			}, 500); // 2000毫秒后执行
		},
		methods: {
			// 获取基本信息数据
			GetHotel() {
				uni.showLoading({
					title: this.app.language.jzz,
				});
				this.info.phone = this.userInfo.phonenumber
				this.info.name = this.userInfo.userName
				this.info.card = this.userInfo.idcard
				let data = {
					appToken: this.token
				}
				// 获取旅店业基本信息
				GetHotelInfo(data).then((res) => {
					if (res.code == 200) {
						if (res.data.hotelBaseList && res.data.hotelBaseList.length > 0) {
							this.isBtn = true
							this.isTB = true
							this.xg = true
							this.form = res.data.hotelBaseList[0]
							this.basepeopleList = this.form.basepeopleList
							this.otherList = this.form.otherList
							// // 户籍地回显
							// let address = res.data.hotelBaseList[0].address.split(' ')
							// let provinceName = address[0]
							// let cityName = address[1]
							// let areaName = address[2]
							// // 1. 查找省份
							// let province = this.areaData.provinces.find(
							// 	p => p.name === provinceName
							// );
							// if (!province) return;

							// // 2. 查找城市
							// let cities = this.areaData.cities[province.code] || [];
							// let city = cities.find(
							// 	c => c.name === cityName
							// );
							// if (!city) return;

							// // 3. 查找区县
							// let areas = this.areaData.areas[city.code] || [];
							// let area = areas.find(
							// 	a => a.name === areaName
							// );
							// if (!area) return;

							// // 设置默认区域
							// this.defaultArea = {
							// 	province,
							// 	city,
							// 	area
							// };
							// 遍历从业人员的性别
							for (let i = 0; i < this.basepeopleList.length; i++) {
								if (this.basepeopleList[i].agent == this.xingbieList[i].dictValue) {
									this.basepeopleList[i].selectedGenderValue = this.xingbieList[i].dictLabel
								}
							}
							// 遍历从业人员的合同
							for (let i = 0; i < this.basepeopleList.length; i++) {
								this.basepeopleList[i].contractImg = this.basepeopleList[i].serviceContract.split(
									',')
							}
							// 循环派出所遍历数据
							for (let i = 0; i < this.pcsList.length; i++) {
								if (this.form.policeStation == this.pcsList[i].deptId) {
									this.selectedpcsValue = this.pcsList[i].deptName
								}
							}
							// 循环经济性质遍历数据
							for (let i = 0; i < this.jingList.length; i++) {
								if (this.form.economicNature == this.jingList[i].dictValue) {
									this.selectedValue = this.jingList[i].dictLabel
								}
							}
							// 循环建筑性质遍历数据
							for (let i = 0; i < this.jianList.length; i++) {
								if (this.form.buildNature == this.jianList[i].dictValue) {
									this.selectedJzValue = this.jianList[i].dictLabel
								}
							}
							// 遍历其他项目的合同
							for (let i = 0; i < this.otherList.length; i++) {
								this.otherList[i].cyryImg = this.otherList[i].employees.split(',')
							}
							// 遍历内防监控
							this.jmhkbImg = this.form.monitoringQuantity.split(',')
							// 消防设施情况
							this.xfImg = this.form.fpdSituation.split(',')
							// 内部保安数量
							this.baImg = this.form.securityGuardsNumb.split(',')
							// 防爆器材数量
							this.fbqcImg = this.form.explosionProofEquipment.split(',')
							// 消防检查合格证
							this.hgzImg = this.form.fireInspectionCertificate.split(',')
							// 特种行业许可证
							this.xkzImg = this.form.specialIndustryLicense.split(',')
							// 旅店业外部概貌照片
							this.lvwmImg = this.form.externalOverviewPhoto.split(',')
							// 旅店业内部概貌照片
							this.lvnmImg = this.form.internalOverviewPhoto.split(',')
							if (this.form.isRent == '0') {
								this.isLeaseShow = false
							} else if (this.form.isRent == '1') {
								this.isLeaseShow = true
								this.zlImg = this.form.rentContract.split(',')
							}
						}
						uni.hideLoading();
					}
				})

			},

			// 获取缓存
			getToken() {
				let that = this
				uni.getStorage({
					key: 'loginData',
					success: function(res) {
						console.log('res', res)
						that.token = res.data.userInfo.appToken
						that.userInfo = res.data.userInfo
						uni.hideLoading();
					}
				});
			},

			nextStep() {
				console.log('isBtn',this.isBtn)
				console.log('this.currentStep',this.currentStep)
				console.log('steps.length - 1',this.steps.length)
				if (this.currentStep == 0) {
					if (this.currentStep < this.steps.length - 1) {
						this.currentStep++;
					}
					return
				}

				if (this.currentStep == 1) {
					// 旅店业名称
					if (!this.form.hotelName) {
						uni.showToast({
							title: this.app.language.ldy_Iname,
							icon: 'none',
						});
						return
					}
					// 地址
					// if (!this.selectedAddressValue || this.selectedAddressValue === this.app.language.qxz) {
						if (!this.form.address) {
						uni.showToast({
							title: this.app.language.ldy_Iaddress,
							icon: 'none',
						});
						return
					}
					// 特种行业证号
					if (!this.form.specialIndustryCertificateNumber) {
						uni.showToast({
							title: this.app.language.ldy_IadminNumber,
							icon: 'none',
						});
						return
					}
					// 占地面积
					if (!this.form.coverArea) {
						uni.showToast({
							title: this.app.language.ldy_Izdarea,
							icon: 'none',
						});
						return
					}
					// 经济性质
					if (!this.selectedValue || this.selectedValue === this.app.language.qxz) {
						uni.showToast({
							title: this.app.language.ldy_ijjxz,
							icon: 'none',
						});
						return
					}
					// 建筑性质
					if (!this.selectedJzValue || this.selectedJzValue === this.app.language.qxz) {
						uni.showToast({
							title: this.app.language.ldy_ijzxz,
							icon: 'none',
						});
						return
					}
					// 经营面积
					if (!this.form.operatingArea) {
						uni.showToast({
							title: this.app.language.ldy_Ijyarea,
							icon: 'none',
						});
						return
					}
					// 房栋数量
					if (!this.form.buildNumber) {
						uni.showToast({
							title: this.app.language.ldy_Ifds,
							icon: 'none',
						});
						return
					}
					// 客房数量
					if (!this.form.roomNumber) {
						uni.showToast({
							title: this.app.language.ldy_IkfNum,
							icon: 'none',
						});
						return
					}
					// 床位数
					if (!this.form.bedNumber) {
						uni.showToast({
							title: this.app.language.ldy_IcwNum,
							icon: 'none',
						});
						return
					}
					// 总台电话
					if (!this.form.phoneNumber) {
						uni.showToast({
							title: this.app.language.ldy_IztPhone,
							icon: 'none',
						});
						return
					}
					// 电梯设置
					if (!this.form.elevatorSetup) {
						uni.showToast({
							title: this.app.language.ldy_Idtsz,
							icon: 'none',
						});
						return
					}
					// 法人
					if (!this.form.legalPerson) {
						uni.showToast({
							title: this.app.language.ldy_IlegalPerson,
							icon: 'none',
						});
						return
					}
					// 身份证号
					if (!this.form.legalIdcard) {
						uni.showToast({
							title: this.app.language.ldy_Icard,
							icon: 'none',
						});
						return
					}
					// 电话号码
					if (!this.form.legalPhone) {
						uni.showToast({
							title: this.app.language.Iphone,
							icon: 'none',
						});
						return
					}
					// 是否同步
					if (!this.isTB) {
						// 根据法人信息查询数据库是否有该字段
						uni.showLoading({
							title: this.app.language.jzz,
						});
						this.info.phone = this.userInfo.phonenumber
						this.info.name = this.userInfo.userName
						this.info.card = this.userInfo.idcard
						let data = {
							hotelName: this.form.hotelName,
							legalPerson: this.form.legalPerson,
							legalPhone: this.form.legalPhone
						}
						console.log('datadatadatadata', data)
						// 获取旅店业基本信息
						GetHotelInfo(data).then((res) => {
							if (res.code == 200) {
								uni.hideLoading();
								if (res.data.hotelBaseList && res.data.hotelBaseList.length > 0) {
									this.hotelBaseList = res.data.hotelBaseList
									this.$refs.popup.open('center')
									return
								} else {
									if (this.currentStep < this.steps.length - 1) {
										this.currentStep++;
									}
									return
								}
							}
						})
					} else {
						if (this.currentStep < this.steps.length - 1) {
							this.currentStep++;
						}
						return
					}
				}

				if (this.currentStep == 2) {
					console.log('this.basepeopleList', this.basepeopleList)
					for (let i = 0; i < this.basepeopleList.length; i++) {
						// 从业人员姓名
						if (!this.basepeopleList[i].name) {
							uni.showToast({
								title: this.app.language.yl_IcyryName,
								icon: 'none',
							});
							return
						}
						// 从业人员性别
						if (!this.basepeopleList[i].selectedGenderValue || this.basepeopleList[i].selectedGenderValue ===
							this.app.language.qxz) {
							uni.showToast({
								title: this.app.language.Igender,
								icon: 'none',
							});
							return
						}
						// 从业人员身份证号
						if (!this.basepeopleList[i].idcard) {
							uni.showToast({
								title: this.app.language.ldy_Icard,
								icon: 'none',
							});
							return
						}
						// 从业人员联系电话
						if (!this.basepeopleList[i].contactNumber) {
							uni.showToast({
								title: this.app.language.Iphone,
								icon: 'none',
							});
							return
						}
						// 劳务合同
						if (!this.basepeopleList[i].contractImg || this.basepeopleList[i].contractImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_icontract,
								icon: 'none',
							});
							return
						}
						if (this.currentStep < this.steps.length - 1) {
							this.currentStep++;
						}
					}
					console.log('通过')
					// if (this.currentStep < this.steps.length - 1) {
					// 	this.currentStep++;
					// }
				}

				// console.log('通过')
				// if (this.currentStep < this.steps.length - 1) {
				// 	this.currentStep++;
				// }

			},

			// 同步信息
			handleTb(item) {
				this.form = item
				this.basepeopleList = this.form.basepeopleList
				this.otherList = this.form.otherList
				// // 户籍地回显
				// let address = this.form.address.split(' ')
				// let provinceName = address[0]
				// let cityName = address[1]
				// let areaName = address[2]
				// // 1. 查找省份
				// let province = this.areaData.provinces.find(
				// 	p => p.name === provinceName
				// );
				// if (!province) return;

				// // 2. 查找城市
				// let cities = this.areaData.cities[province.code] || [];
				// let city = cities.find(
				// 	c => c.name === cityName
				// );
				// if (!city) return;

				// // 3. 查找区县
				// let areas = this.areaData.areas[city.code] || [];
				// let area = areas.find(
				// 	a => a.name === areaName
				// );
				// if (!area) return;

				// // 设置默认区域
				// this.defaultArea = {
				// 	province,
				// 	city,
				// 	area
				// };
				// 遍历从业人员的性别
				if (this.basepeopleList.length > 0) {
					for (let i = 0; i < this.basepeopleList.length; i++) {
						if (this.basepeopleList[i].agent == this.xingbieList[i].dictValue) {
							this.basepeopleList[i].selectedGenderValue = this.xingbieList[i].dictLabel
						}
					}
					// 遍历从业人员的合同
					for (let i = 0; i < this.basepeopleList.length; i++) {
						if (this.basepeopleList[i].serviceContract) {
							this.basepeopleList[i].contractImg = this.basepeopleList[i].serviceContract
								.split(',')
						}else{
							this.this.basepeopleList[i].contractImg = []
						}
						
					}
				}

				// 循环户籍地址遍历数据
				for (let i = 0; i < this.hjsList.length; i++) {
					if (this.form.address == this.hjsList[i].domicileId) {
						this.selectedAddressValue = this.hjsList[i].domicileName
					}
				}
				// 循环派出所遍历数据
				for (let i = 0; i < this.pcsList.length; i++) {
					if (this.form.policeStation == this.pcsList[i].deptId) {
						this.selectedpcsValue = this.pcsList[i].deptName
					}
				}
				// 循环经济性质遍历数据
				for (let i = 0; i < this.jingList.length; i++) {
					if (this.form.economicNature == this.jingList[i].dictValue) {
						this.selectedValue = this.jingList[i].dictLabel
					}
				}
				// 循环建筑性质遍历数据
				for (let i = 0; i < this.jianList.length; i++) {
					if (this.form.buildNature == this.jianList[i].dictValue) {
						this.selectedJzValue = this.jianList[i].dictLabel
					}
				}
				if (this.otherList.length > 0) {
					// 遍历其他项目的合同
					for (let i = 0; i < this.otherList.length; i++) {
						if (this.otherList[i].employees) {
							this.otherList[i].cyryImg = this.otherList[i].employees.split(',')
						}else{
							this.otherList[i].cyryImg = []
						}
					}
				}

				// 遍历内防监控
				if (this.form.monitoringQuantity) {
					this.jmhkbImg = this.form.monitoringQuantity.split(',')
				}

				// 消防设施情况
				if (this.form.fpdSituation) {
					this.xfImg = this.form.fpdSituation.split(',')
				}
				// 内部保安数量
				if (this.form.securityGuardsNumb) {
					this.baImg = this.form.securityGuardsNumb.split(',')
				}
				// 防爆器材数量
				if (this.form.explosionProofEquipment) {
					this.fbqcImg = this.form.explosionProofEquipment.split(',')
				}
				// 消防检查合格证
				if (this.form.fireInspectionCertificate) {
					this.hgzImg = this.form.fireInspectionCertificate.split(',')
				}
				// 特种行业许可证
				if (this.form.specialIndustryLicense) {
					this.xkzImg = this.form.specialIndustryLicense.split(',')
				}
				// 旅店业外部概貌照片
				if (this.form.externalOverviewPhoto) {
					this.lvwmImg = this.form.externalOverviewPhoto.split(',')
				}
				// 旅店业内部概貌照片
				if (this.form.internalOverviewPhoto) {
					this.lvnmImg = this.form.internalOverviewPhoto.split(',')
				}
				// 是否租赁
				if (this.form.isRent) {
					if (this.form.isRent == '0') {
						this.isLeaseShow = false
					} else if (this.form.isRent == '1') {
						this.isLeaseShow = true
						this.zlImg = this.form.rentContract.split(',')
					}
				}
				this.isBtn = false
				this.isTB = true
				this.$refs.popup.close()

			},

			previousStep() {
				if (this.currentStep > 0) {
					this.currentStep--;
				}
			},

			// 获取建筑性质的列表
			getJzList() {
				getJzxz().then((res) => {
					if (res.code == 200) {
						this.jianList = res.rows
						for (let i = 0; i < res.rows.length; i++) {
							this.list.push(res.rows[i].dictLabel);
						}
					}
				})
			},

			// 获取派出所列表
			getPcs() {
				let data = {
					"": ""
				}
				getPcsList(data).then((res) => {
					this.pcsList = res.data
					console.log('res.data', res.data)
					if (res.code == 200) {
						for (let i = 0; i < res.data.length; i++) {
							this.pcssList.push(res.data[i].deptName);
						}
					}
				})
			},

			// 选择派出所
			onpcsChange(e) {
				this.selectedpcsValue = this.pcssList[e.detail.value];
				this.form.policeStation = this.pcsList[e.detail.value].deptId;
			},

			// 获取经济性质
			getJjList() {
				getJjxz().then((res) => {
					if (res.code == 200) {
						this.jingList = res.rows
						for (let i = 0; i < res.rows.length; i++) {
							this.jzlist.push(res.rows[i].dictLabel);
						}
					}
				})
			},

			async loadAreaData() {
				uni.showLoading({
					title: this.app.language.jzz
				});

				try {
					const data = await fetchAndProcessAreaData();
					if (data) {
						this.areaData = data;
					}
					// else {
					// 	uni.showToast({
					// 		title: '加载地区数据失败',
					// 		icon: 'none'
					// 	});
					// }
				} catch (error) {
					console.error('加载地区数据出错:', error);
					// uni.showToast({
					// 	title: '加载地区数据出错',
					// 	icon: 'none'
					// });
				} finally {
					uni.hideLoading();
				}
			},
			// 三级联动
			handleFirstAreaChange(selected) {
				console.log('selected', selected)
				// this.firstSelectedArea = selected;
				console.log('第一个选择器选择:', selected);
				this.selectedAddressValue = selected.fullText
				this.form.address = selected.fullText
				console.log('this.form.address', this.form.address)
			},

			// 获取性别列表
			getagent() {
				geAgent().then((res) => {
					this.xingbieList = res.rows
					for (let i = 0; i < res.rows.length; i++) {
						this.genderList.push(res.rows[i].dictLabel);
					}
				})
			},

			// 选择性别
			onChangeCzGender(index, e) {
				console.log('index', index)
				console.log('e', e)
				console.log('this.genderList', this.genderList)
				this.basepeopleList[index].selectedGenderValue = this.genderList[e.detail.value];
				this.basepeopleList[index].agent = this.xingbieList[e.detail.value].dictValue;
			},

			// 经济性质
			onChange(e) {
				this.selectedValue = this.jzlist[e.detail.value];
				this.form.economicNature = this.jingList[e.detail.value].dictValue;
			},

			// 建筑性质
			onJzChange(e) {
				this.selectedJzValue = this.list[e.detail.value];
				this.form.buildNature = this.jianList[e.detail.value].dictValue;
			},

			// 上传图片
			chooseImg(item, index) {
				console.log('item', item)
				console.log('index', index)
				uni.chooseImage({
					count: 8,
					success: (res) => {
						this.srcImg = res.tempFilePaths

						let tempFilePaths = res.tempFilePaths;
						// this.tempFilePathList = res.tempFilePaths;
						let base64List = this.form.chooseImags;
						// 图片路径转换成base64格式
						tempFilePaths.forEach((item, index) => {
							uni.getFileSystemManager().readFile({
								filePath: item, // 图片文件路径
								encoding: 'base64', // 编码格式为base64
								success: res => { // 成功回调
									let base64 = 'data:image/jpeg;base64,' + res
										.data; // 拼接data URI
									base64List.push(base64);
									if (base64List.length === tempFilePaths.length) {
										this.form.chooseImags = base64List;
									}
								},
								fail: err => {
									console.error('读取文件失败', err);
								}
							});
						});

						// 上传图片并返回路径
						let imgList = [];
						// 上传前显示加载中
						uni.showLoading({
							title: this.app.language.jzz,
						});
						tempFilePaths.forEach((tempFilePaths) => {
							const uploadTask = uni.uploadFile({
								url: 'https://mqzhian.cn:8088/common/upload', // 你的ThinkPHP服务器地址
								filePath: tempFilePaths,
								name: 'file', // 这里根据服务器接收的字段来定义
								success: (uploadFileRes) => {
									const data = JSON.parse(uploadFileRes.data);
									console.log('上传成功', data);
									// 上传成功后隐藏加载中
									uni.hideLoading();
									// 这里处理返回的图片路径，例如保存到数组中
									imgList.push(data.fileName);
									if (item == 1 && index >= 0) {
										this.basepeopleList[index].contractImg = imgList
										this.basepeopleList[index].serviceContract =
											imgList.join(',')
									} else if (item == 2 && index >= 0) {
										this.otherList[index].cyryImg = imgList
										this.otherList[index].employees = imgList.join(',')
									} else if (item == 3) {
										this.jmhkbImg = imgList
										this.form.monitoringQuantity = imgList.join(',')
									} else if (item == 4) {
										this.xfImg = imgList
										this.form.fpdSituation = imgList.join(',')
									} else if (item == 5) {
										this.baImg = imgList
										this.form.securityGuardsNumb = imgList.join(',')
									} else if (item == 6) {
										this.fbqcImg = imgList
										this.form.explosionProofEquipment = imgList.join(
											',')
									} else if (item == 7) {
										this.hgzImg = imgList
										this.form.fireInspectionCertificate = imgList.join(
											',')
									} else if (item == 8) {
										this.xkzImg = imgList
										this.form.specialIndustryLicense = imgList.join(
											',')
									} else if (item == 9) {
										this.lvwmImg = imgList
										this.form.externalOverviewPhoto = imgList.join(',')
									} else if (item == 10) {
										this.lvnmImg = imgList
										this.form.internalOverviewPhoto = imgList.join(',')
									} else if (item == 11) {
										this.zlImg = imgList
										this.form.rentContract = imgList.join(',')
									}
								},
								fail: (error) => {
									console.error('上传失败', error);
									uni.showToast({
										title: this.app.language.scerror,
										icon: 'none',
									});
								}
							});
						});
					}
				})
			},

			// 预览图片
			previewImg(current) {
				uni.previewImage({
					current,
					urls: this.srcImg,
					// 图片指示器样式: 小圆点
					indicator: 'default',
					// 循环预览
					loop: true
				})
			},

			// 删除图片
			delImg(index, id) {
				console.log('id', id)
				console.log('index', index)
				uni.showModal({
					title: this.app.language.titDel, // 弹框标题
					content: this.app.language.delBtn, // 弹框内容
					cancelText: this.app.language.popCancelText, // 取消按钮文本
					confirmText: this.app.language.okBtn, // 确认按钮文本
					success: (res) => {
						if (res.confirm) {
							// 用户点击了“确定”按钮
							if (id == 1) {
								this.basepeopleList[index].contractImg = []
								this.basepeopleList[index].serviceContract = ""
								console.log('this.basepeopleList', this.basepeopleList)

							} else if (id == 2) {
								console.log('2', index)
								this.otherList[index].cyryImg = []
								this.otherList[index].employees = ""
								console.log('this.otherList', this.otherList)
							} else if (id == 3) {
								this.jmhkbImg = []
								this.form.monitoringQuantity = ""
							} else if (id == 4) {
								this.xfImg = []
								this.form.fpdSituation = ""
							} else if (id == 5) {
								this.baImg = []
								this.form.securityGuardsNumb = ""
							} else if (id == 6) {
								this.fbqcImg = []
								this.form.explosionProofEquipment = ""
							} else if (id == 7) {
								this.hgzImg = []
								this.form.fireInspectionCertificate = ""
							} else if (id == 8) {
								this.xkzImg = []
								this.form.specialIndustryLicense = ""
							} else if (id == 9) {
								this.lvwmImg = []
								this.form.externalOverviewPhoto = ""
							} else if (id == 10) {
								this.lvnmImg = []
								this.form.internalOverviewPhoto = ""
							} else if (id == 11) {
								this.zlImg = []
								this.form.rentContract = ""
							}
						} else if (res.cancel) {
							// 用户点击了“取消”按钮，或者关闭了弹框
							console.log('用户取消删除');
						}
					}
				});
			},

			//  从业人员新增
			handleAdd() {
				let prem = {
					name: "",
					agent: "",
					idcard: "",
					contactNumber: "",
					serviceContract: "",
					contractImg: [],
					selectedGenderValue: this.app.language.qxz,
				}
				this.basepeopleList.push(prem); // 添加一个新的空表单项
			},

			// form表单-1
			handleDel(index) {
				let that = this
				// uni.showModal({
				// 	// title: '提示',
				// 	content: '确定要删除吗?',
				// 	success: function(res) {
				// 		if (res.confirm) {

				// 			// 用户点击了确定按钮的相关逻辑可以放在这里
				// 		} else if (res.cancel) {
				// 			console.log('用户点击取消');
				// 			// 用户点击了取消按钮的相关逻辑可以放在这里
				// 		}
				// 	}
				// });
				that.basepeopleList.splice(index, 1); // 移除指定索引的表单项
			},

			// 是否租赁
			handleChange(e) {
				this.isLease = e.detail.value;
				this.form.isRent = e.detail.value
				if (this.isLease == 1) {
					this.isLeaseShow = true
				} else if (this.isLease == 0) {
					this.isLeaseShow = false
					this.zlImg = []
					this.form.rentContract = ""
				}
				console.log('this.form', this.form)
			},
			
			// 提交
			submitForm(val) {
				this.form.appToken = this.token
				this.form.basepeopleList = this.basepeopleList
				this.form.otherList = this.otherList
				if (this.currentStep == 3) {
					for (let i = 0; i < this.otherList.length; i++) {
						// 项目经营名称
						if (!this.otherList[i].projectManagementName) {
							uni.showToast({
								title: this.app.language.ldy_IxmjyName,
								icon: 'none',
							});
							return
						}
						// 业主姓名
						if (!this.otherList[i].ownersName) {
							uni.showToast({
								title: this.app.language.ldy_IyzName,
								icon: 'none',
							});
							return
						}
						// 身份证号码
						if (!this.otherList[i].idcard) {
							uni.showToast({
								title: this.app.language.ldy_Icard,
								icon: 'none',
							});
							return
						}
						// 电话号码
						if (!this.otherList[i].phoneNumber) {
							uni.showToast({
								title: this.app.language.Iphone,
								icon: 'none',
							});
							return
						}
						// 从业人员
						if (!this.otherList[i].cyryImg || this.otherList[i].cyryImg.length == 0) {
							uni.showToast({
								title: this.app.language.cyrylwht,
								icon: 'none',
							});
							return
						}
						// 内防监控数量
						if (this.jmhkbImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_infjkNum,
								icon: 'none',
							});
							return
						}
						// 消防设施情况
						if (this.xfImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_ixfssqk,
								icon: 'none',
							});
							return
						}
						// 内部保安数量
						if (this.baImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_ibaNum,
								icon: 'none',
							});
							return
						}
						// 防爆器材数量
						if (this.fbqcImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_ifbqcNum,
								icon: 'none',
							});
							return
						}
						// 消防检查合格证
						if (this.hgzImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_ixfhgz,
								icon: 'none',
							});
							return
						}
						// 特种行业许可证
						if (this.xkzImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_itzhyxkz,
								icon: 'none',
							});
							return
						}
						// 旅店业外部概貌照片
						if (this.lvwmImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_ildwm,
								icon: 'none',
							});
							return
						}
						// 旅店业内部概貌照片
						if (this.lvnmImg.length == 0) {
							uni.showToast({
								title: this.app.language.ldy_ildnm,
								icon: 'none',
							});
							return
						}
						// 是否租赁	
						if (this.form.isRent !== '0' && this.form.isRent !== '1') {
							uni.showToast({
								title: this.app.language.ldy_iisLease,
								icon: 'none',
							});
							return
						}
						// 租赁合同
						if (this.form.isRent == '1' && this.zlImg.length == 0) {
							uni.showToast({
								title: this.app.language.icyrylwht,
								icon: 'none',
							});
							return
						}
					}
				}
				if(val==0){
					uni.showLoading({
						title: this.app.language.jzz,
					});
					AddhotelInfo(this.form).then((res) => {
						if (res.code == 200) {
							uni.hideLoading();
							uni.showToast({
								title: this.app.languageqddsh,
								icon: 'success',
							});
							setTimeout(() => {
								console.log('跳转首页')
								uni.reLaunch({
									url: '/pages/hotel/listText'
								});
							}, 1000);
						}
					})
				}else if(val==1){
					console.log('this.form',this.form)
					uni.showLoading({
						title: this.app.language.jzz,
					});
					xghotelInfo(this.form).then((res) => {
						if (res.code == 200) {
							uni.hideLoading();
							uni.showToast({
								title: this.app.languageqddsh,
								icon: 'success',
							});
							setTimeout(() => {
								console.log('跳转首页')
								uni.reLaunch({
									url: '/pages/hotel/listText'
								});
							}, 1000);
						}
					})
				}
				

			}
		}
	};
</script>
<style>
	.container {
		padding: 10rpx 20rpx;
	}

	.form {
		border: 1px solid #ddd;
		box-shadow: 1px 1px 10rpx #ddd;
		padding: 0 20rpx;
		margin-top: 20rpx;
		position: relative
	}

	.formItem1,
	.formItem {
		margin: 10rpx 0;
		padding: 10rpx;
		/* height: 162rpx; */
		position: relative;
		border-bottom: 1px dashed #ddd
	}

	.formB {
		/* background-color: #f3f3f3; */
		font-size: 24rpx;
		padding: 10rpx;
		margin-top: 10rpx;
		position: absolute;
		right: 10rpx;
		top: -2rpx;
		text-align: right;
		color: #808080;
	}

	.formB input {
		position: relative;
		right: 23rpx;
	}

	.formItem1 text,
	.formItem text {
		font-size: 26rpx;
	}

	.title {
		border-left: 4rpx solid #2f8ef9;
		padding-left: 10rpx;
		margin: 10rpx 0 10rpx 10rpx;
		font-weight: bold;
		font-size: 26rpx;
	}

	.nextStep,
	.previousStep,
	.submitForm {
		background-color: #2f8ef9;
		color: #fff;
		font-size: 26rpx;
		margin-top: 20rpx;
	}

	.bt {
		color: red;
		margin-right: 5rpx;
	}

	.hjbImg button {
		font-size: 22rpx;
		width: 149rpx;
		height: 56rpx;
		background: #2f8ef9;
		color: #fff;
	}

	.hjbImg {
		/* position: absolute;
		bottom: 10rpx; */
		width: 150rpx;
		margin-top: -17rpx;
	}

	.hjbImg1 {
		width: 150rpx;
		margin-top: 20rpx !important;
	}

	.jia {
		border: 1px dashed #2f8ef9;
		text-align: center;
		color: #2f8ef9;
		margin: 20rpx auto 0;
		font-size: 26rpx;
		border-radius: 10rpx;
		padding: 0 0 13rpx;
	}

	.jia image {
		width: 40rpx;
		height: 40rpx;
		position: relative;
		top: 8rpx;
	}

	.del {
		width: 25px;
		height: 25px;
		position: absolute;
		right: -5px;
		top: -8px;
	}

	.radioGroup {
		position: relative;
		top: -13rpx;
	}

	.picker {
		width: 260rpx;
		color: #808080;
		position: relative;
		right: 17rpx;
	}

	.radioYes {
		margin-right: 20rpx;
	}

	.scimageBox {
		display: inline-block;
		width: 100%;
		height: 100rpx;
		position: relative;
		/* text-align: center; */
	}

	.scimage {
		width: 121rpx;
		height: 80rpx;
		margin-right: 10rpx;
		margin-top: 5px;
		border-radius: 5rpx;
	}

	.del3 {
		color: red;
		font-size: 26rpx;
		text-align: right;
		width: 50rpx;
		height: 50rpx;
		position: absolute;
		right: 0;
		top: -43rpx;
	}

	.delImg {
		width: 50rpx;
		height: 50rpx;
	}

	.popupBox {
		background-color: #fff;
		width: 650rpx;
		padding: 36rpx;
		border-radius: 10rpx;
	}

	.popupItem {
		display: flex;
		padding-bottom: 10rpx;
		border-bottom: 1px solid #ddd;
		margin: 15rpx 0;
	}

	.popupItem button {
		font-size: 24rpx;
		height: 40rpx;
		line-height: 40rpx;
		width: 154rpx;
		background-color: #2f8ef9;
		color: #fff;
	}

	.popupItem text {
		width: 361rpx;
		margin-right: 10rpx;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		/* 限制显示的行数 */
		overflow: hidden;
	}
	
	radio-group {
		position: relative;
		top: -9px!important;
	}
</style>